﻿<%@ Page Title="Financial Year Master" Language="C#" MasterPageFile="~/AuditBillingMaster.master" AutoEventWireup="true" CodeFile="FinanceYearMaster.aspx.cs" Inherits="FinanceYearMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../JS/Forms/jsFinanceYearMaster.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cntList" runat="Server">
    <asp:HiddenField runat="server" ID="hdnExportToExcelFilePath" ClientIDMode="Static" />
    <input type="hidden" id="hdnFinancialYearID" runat="server" value="0" clientidmode="Static" />
    <div class="pagecontent">
        <div class="headercontainer">
            <div class="headertextcontainer halfpanel">
                Financial Year Master
            </div>
            <div class="headerbuttoncontainer halfpanel">
                <a id="A1" href='javascript:void(0);' onclick="toggle_TopContainer();" tabindex="5" class="headersearchbutton" title="Toggle Search Panel" runat="server">Search</a>&nbsp;&nbsp;<a
                    runat="server" href='javascript:void(0);' id="lnkAdd" tabindex="6" clientidmode="Static" class="headeraddbutton" title="Add Company"
                    onclick='javascript:ShowEditDiv(0,this);'>Add Financial Year</a>
                <a href="#" onclick="fn_ExportToExcel();" class="headerexportbutton">Export To Excel</a>

            </div>
        </div>
        <div id="divTopContainer" class="topcontainerwrapper">
            <div class="topcontainerSmall" onkeypress="javascript:return fireDefaultButton(event, 'btnSearch')">
                <div class="halfpanel">
                    <div class="row">
                        <asp:TextBox ID="txtSearchFinYear" runat="server" ClientIDMode="Static" MaxLength="50"
                            TabIndex="1" CssClass="searchCntrl" placeholder="Fin. Year Name"></asp:TextBox>
                    </div>
                </div>
                <div class="halfpanel">
                    <div class="row">
                        <asp:DropDownList ID="cboStatus" ClientIDMode="Static" runat="server" TabIndex="2"
                            CssClass="searchCntrl" Width="70%">
                            <asp:ListItem Value="2" Text="Both[Fin. Year Closed]"></asp:ListItem>
                            <asp:ListItem Value="1" Text="Active"></asp:ListItem>
                            <asp:ListItem Value="0" Text="InActive"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="fullpanel textalignright">
                    <a tabindex="3" class="btn-search-clear" onclick="clear_form_elements('divTopContainer');" onkeypress="clear_form_elements_ForTab(event,'divTopContainer');" href="javascript:void(0);">Clear</a>
                    <input type="button" id="btnSearch" tabindex="3" class="btn-search" onclick="javascript: return fn_GetSearchResult(0);"
                        value="Search" title="Search" />
                </div>
            </div>
            <a href='javascript:void(0);' class="closedivSmall" onclick="toggle_TopContainer();" title="Toggle Search Panel" tabindex="4"><i class="fa fa-chevron-up"></i></a>
        </div>
        <div class="maincontainer">
            <div class="listpagediv" id="divResult">
                <asp:GridView ID="grdResult" runat="server" ClientIDMode="Static" AutoGenerateColumns="false" Width="70%" CssClass="listdiv" DataKeyNames="FinancialYearID" OnRowDataBound="grdResult_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="FinancialYearID" HeaderText="Financial Year ID" />
                        <asp:BoundField HeaderText="Sr." ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%# (Convert.ToBoolean(Eval("IsFinYearClosed")) == true ? "" :
                                      "<a class=\"btn-edit\" href=\"javascript:void(0);\" onclick=\"return ShowEditDiv(1,this);\" title=\"Edit\"><i class=\"fa fa-pencil\" title=\"Edit\"></i></a>")
                                %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="FinYearName" HeaderText="Name" />
                        <asp:BoundField DataField="FinYearStartDate" HeaderText="Fin. Year Start Date" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="FinYearEndDate" HeaderText="Fin. Year End Date" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField HeaderText="Current Fin. Year" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%#(Convert.ToBoolean(Eval("IsCurrentFinYear")) == true ? "Yes" : "No") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Fin. Year Closed" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%#(Convert.ToBoolean(Eval("IsFinYearClosed")) == true ? "Yes" : "No") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>

        </div>
    </div>
    <div class="modalopenConfirmDel modalopenFinancialYear" style="display: none;">
    </div>

    <div id="divInsertEdit" class="modalFinancialYear" onkeypress="javascript:return fireDefaultButton(event, 'btnSave')">
        <div class="form">
            <div class="innercontent">
                <div class="halfpanel">
                    <div class="row">
                        <div class="midium-label">
                            Fin. Year Name&nbsp;&nbsp;<span class="red">*</span>
                        </div>
                        <div class="midium-value">
                            <asp:TextBox ID="txtFinYearName" runat="server" ClientIDMode="Static" Width="97%"
                                MaxLength="50" placeholder="Enter Financial Year Name" CssClass="input" TabIndex="100"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvtxtFinYearName" runat="server" Display="Dynamic" ClientIDMode="Static"
                                ControlToValidate="txtFinYearName" ValidationGroup="vgSave" ErrorMessage="Enter Financial Year Name"
                                Width="90%"><span class="error">Enter financial year name</span></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cvtxtFinYearName" runat="server" ClientIDMode="Static" ControlToValidate="txtFinYearName"
                                ClientValidationFunction="fn_ValidateExpressionTextbox" ValidationGroup="vgSave" ValidateEmptyText="false" expressionid="AlpNumSplChar"
                                Display="Dynamic" Width="90%"><span id="spnFirstName" class="error"></span></asp:CustomValidator>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="row">
                        <div class="midium-label">
                            Fin. Year Start Date
                        </div>
                        <div class="midium-value">
                            <div class="input-append date">
                                <asp:TextBox ID="txtFinYearStartDate" runat="server" ClientIDMode="Static" MaxLength="50"
                                    onclick="show_DateCalender('txtFinYearStartDate');" TabIndex="102" CssClass="dateinput"
                                    ReadOnly="true" placeholder="dd/mm/yyyy" onkeydown="javascript:return clearDates(event);"></asp:TextBox>
                                <span class="add-on" id="Span8" onclick="show_DateCalender('txtFinYearStartDate');" style="float: right"><i
                                    class="icon-th"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="halfpanel">
                    <div class="row">
                        <div>
                            &nbsp;
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="row">
                        <div class="midium-label">
                            Fin. Year End Date
                        </div>
                        <div class="midium-value">
                            <div class="input-append date">
                                <asp:TextBox ID="txtFinYearEndDate" runat="server" ClientIDMode="Static" MaxLength="50"
                                    onclick="show_DateCalender('txtFinYearEndDate');" TabIndex="103" CssClass="dateinput"
                                    ReadOnly="true" placeholder="dd/mm/yyyy" onkeydown="javascript:return clearDates(event);"></asp:TextBox>
                                <span class="add-on" id="Span1" onclick="show_DateCalender('txtFinYearEndDate');" style="float: right"><i
                                    class="icon-th"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
                <div class="pagefooter">
                    <center>
                        <input type="button" id="btnSave" onclick="javascript: return fn_SaveDetails();"
                            tabindex="106" value="Save" validationgroup="vgSave" class="btn-primary" />
                    </center>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cntMain" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="FootContent" runat="Server">
</asp:Content>

